const koa = require("koa");
const bodyParser = require("koa-bodyparser");

//统一注册路由
const registerRouters = require("../router");
// const userRouter = require("../router/use_router");
// const loginRouter = require("../router/login_router");

//1.创建app
const app = new koa();

//2.使用中间件
//解析body参数
app.use(bodyParser());

// //用户注册路由
// app.use(userRouter.routes());
// app.use(userRouter.allowedMethods());

// //登录路由
// app.use(loginRouter.routes());
// app.use(loginRouter.allowedMethods());

registerRouters(app);

module.exports = app;
